Executing Programs
Previous  Top  Next



Use the following commands and functions to execute external programs and minimize/restore the NoteTab window. See also Disk Directories for related commands.


Commands:

^!ActivateApp

Activates the NoteTab application Window. If NoteTab is minimized or behind other windows, the window is restored and brought to the front.

^!ChDir DirName
This command only affects shell commands and is used to define the default directory used by the launched application.

^!CmdShow [Normal|Minimize|Maximize]
Use this command to display the next program to be launched through the Clipbook minimized/maximized. The following values can be used:
Normal
: Program is launched using the default window style.
Minimize
: Program is launched minimized.
Maximize
: Program is launched maximized.

^!CommandLine
Executes the specified program command unless it represents a Clip command. See also the new ^!Shell command below.

^!Dos DosCommand
Executes the specified Dos-shell command or program. The Dos window is closed when the command or program has finished executing. Example: ^!Dos dir *.*


^!Email Address;Subject[;+]
or
^!Email Address;Subject;MessageText
(added in v4.6)
Creates a new e-mail message. The e-mail address and subject should be separated by a semicolon (;). The third parameter with the "+" is optional. When used, it tells the Clipbook that the content of the current document should be used for the body of the message. Since version 4.6, you can include a whole message text after the Subject parameter.
The following Clip example will create a new e-mail message with the address "sales@fookes.com" and the subject "Order for NoteTab Pro":
^!Email sales@fookes.com;Order for NoteTab Pro
The next example will create a new e-mail message with no preset address, the subject "Please check!", and the content of the current document:
^!Email ;Please check!;+

^!FocusApp AppTitle (added in v4.52)
Activates the application window with a title caption that matches the specified text. The error flag is set if no matching window is found. For example, if the Windows calculator utility is open, the following command will bring it to the front:
^!FocusApp Calculator
Most applications usually show other information in the title bar. For these cases, you can use an asterisk "*" either at the beginning or the end of the AppTitle text to specify that the text should match the end or the beginning of the title respectively. For example, MS Wordpad displays the document name in front of the program name, so the following instruction will work if Wordpad is open:
^!FocusApp *WordPad

^!MinimizeApp
Minimizes the NoteTab application Window. This can often make clips run faster. But note that some commands, (such as ^!Keyboard
), do not work properly when the editor window is minimized.

^!Run CommandLine
This command is provided for backward compatibility. It can be used to launch other programs. The ^!Wait command does not work with programs launched this way.

^!SetStdErrorName FileName
Defines the default filename for the StdError output generated by console applications. If you don't specify a path, the NoteTab application directory is used.

^!Shell CommandLine (added in v4.82)
Launches the specified file, program, or URL through the Windows shell. Proposed as a replacement for the default "^!" launch method. Example: instead of using "^!WordPad c:\autoexec.bat", use "^!Shell WordPad c:\autoexec.bat"

^!ShellWait CommandLine (added in v4.82)
Similar to the ^!Shell command, but waits until the launched program is terminated before moving to the next Clip instruction. Unlike the ^!Wait command, you can continue editing files in NoteTab while the application is running. Example:
^!ShellWait WordPad c:\autoexec.bat


^!Url <url>
or
^!Url [browser] <url>

Opens the specified URL in the default browser. You can also optionally specify the browser command in square brakets (which are required). The following example will open the Fookes Software Web site in Internet Explorer; the "-nohome" switch is recognized by Internet Explorer and makes it skip the opening of the homepage:
^!Url [iexplore.exe -nohome] www.fookes.com

If you have Netscape 6.x installed on your computer, you can launch it like this:
^!Url [Netscape6] www.fookes.com

You can launch Internet Explorer with [IExplore]
, Mozilla with [Mozilla], Netscape 4.x with [Netscape], and Opera with [Opera]. For other browsers, you can specify the program name (include the .exe extension and full path if necessary).

^!Wait
This instruction will interrupt Clip execution until the previously launched application has closed. You cannot use the editor when it is in Wait mode (the editor's window caption indicates it is waiting for the application to close). Note that the ^!Wait command may not work with all applications (during testing, it did not work with the MS-Write program).


Functions:

^$GetDosOutput("Command")$
Returns output from DOS command. "Command" represents command to execute. The stderr stream is saved in a file called "StdError.err" in NoteTab's application directory unless another file is specified with the SetStdErrorName command. Prior to version 4.8, this command was only available in the commercial and trial versions of NoteTab.
Example: ^$GetDosOutput(dir c:\*.*)$


^$GetInputOutput("Command")$
Launches the console program specified by "Command" and sends the current document text to the StdInput data stream. The function returns the console's StdOutput data stream. The stderr stream is saved in a file called "StdError.err" in NoteTab's application directory unless another file is specified with the SetStdErrorName command. Prior to version 4.8, this command was only available in the commercial and trial versions of NoteTab.

^$GetOutput("Command")$
Returns the console's output. "Command" represents the command to execute. The stderr stream is saved in a file called "StdError.err" in NoteTab's application directory unless another file is specified with the SetStdErrorName command. Prior to version 4.8, this command was only available in the commercial and trial versions of NoteTab.
Example: ^$GetOutput(command.com /c dir c:\*.*)$